//
//  CustomDownTableViewCell.m
//  ChunLaiZhuangClient
//
//  Created by zzs on 16/3/7.
//  Copyright © 2016年 CLZ. All rights reserved.
//

#import "CustomDownTableViewCell.h"
#import "CustomProductView.h"
@implementation CustomDownTableViewCell


+ (instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *identifier = @"status";
    // 1.缓存中取
    CustomDownTableViewCell*cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    // 2.创建
    if (cell == nil) {
        cell = [[CustomDownTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
    }
    return cell;
}
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.contentView.backgroundColor=[UIColor colorWithHexString:@"efeff4"];
        _nameLabel=[[UILabel alloc] initWithFrame:CGRectMake(14, 0,200,30)];
        _nameLabel.text=@"视频里采购的商品如下";
        _nameLabel.font=[UIFont systemFontOfSize:12];
        _nameLabel.textColor=[UIColor colorWithHexString:@"939393"];
        [self addSubview:_nameLabel];
        _bgScrollView=[[UIScrollView alloc] initWithFrame:CGRectMake(0,30,SCREEN_WIDTH,142)];
        _bgScrollView.showsHorizontalScrollIndicator=NO;
        _bgScrollView.contentSize=CGSizeMake(SCREEN_WIDTH*2, 142);
        
        for (int i=0; i<5; i++) {
         CustomProductView *productView=[[[NSBundle mainBundle] loadNibNamed:@"CustomProductView"  owner:self options:nil] lastObject];
            productView.top=0;
            productView.left=13+(productView.width+10)*i;
            [_bgScrollView addSubview:productView];
        }
        [self addSubview:_bgScrollView];

        
    }
    return self;
}

@end
